<%@ page import="databeans.*"%>
<%@ page import="java.util.*" %>

<html>
<head>

<title>Customer View Payment History</title>
</head>
<body>
<h1>Customer View Payment History </h1>

<%
    java.util.List<String> errors = (List) request.getAttribute("errors");
	if (errors != null && errors.size() > 0) {
		for (String error : errors) {
%>
			<%= error %> <br/>
<% 
		}
	}
%>

Payment History Details: <br/>
<table width="464" border="1" id="colorize_1">
  <tr>
    <td width="114">Transaction Date </td>
    <td width="128">Transaction Type </td>
    <td width="100">Amount</td>
    <td width="94">Status</td>
  </tr>
  <% 
  ArrayList<Date> transDates = (ArrayList<Date>)request.getAttribute("transDates");
  ArrayList<String> transTypes = (ArrayList<String>)request.getAttribute("transTypes"); 
  ArrayList<Double> amounts = (ArrayList<Double>)request.getAttribute("amounts");
  ArrayList<String> statuses = (ArrayList<String>)request.getAttribute("statuses"); 
  if (transTypes.size()==0){
  %>
  <tr>You have no payment transaction so far. </tr>
 <% 
 }else{
 %>
  <tr>
 <%
	for(int i=0; i<transDates.size(); i++){
 %>

    <td><%=transDates.get(i).toString() %></td>
    <td><%=transTypes.get(i) %></td>
    <td><%=amounts.get(i) %></td>
    <td><%=statuses.get(i) %></td>
 <%
  }
%>
  </tr>
<%
 }
%>
</table>

</body>
</html>

